Data source: HESA
In [14]:
import pyexcel as p
sheet = p.get_sheet(url='https://raw.githubusercontent.com/pyexcel/pyexcel-chart/master/hesa-students-data-2005-2015.csv")
sheet.top()
Out[14]:
In [15]:
sheet.column[1]
Out[15]:
In [16]:
def to_integer(cell):
if ',' in cell:
cell = cell.replace(',', '')
cell = int(cell)
return cell
sheet.column.format([1,2,3,4,5], to_integer)
#sheet.plot(chart_type='bar')
sheet.column[1]
Out[16]:
In [17]:
del sheet.column[5]
In [18]:
sheet.plot(
chart_type='stackedbar',
title='First year students by level and mode of study 2005/06 to 2015/16',
legend_at_bottom=True, legend_at_bottom_columns=2,
range=(0, 1200000)
)
Out[18]: